import React from 'react'
import TopNav from '../Public/TopNav'
import Search from '../Public/Search'
import ContNav from '../Public/ContNav'
import Bottom from '../Public/Footer'

import {Route,Switch,Redirect} from 'react-router-dom'
import Index from '../Index'        // 首页地址
import GreatLife from '../GreatLife'    // 精彩生活地址
import LifeFood from '../LifeFood'     // 生活食品地址
import LifeArticles from '../LifeArticles' // 生活用品地址
import LifeHouse from '../LifeHouse'    // 生活家居地址
import Member from '../Member'       // 会员杂锦地址
import AboutUs from '../AboutUs'      // 关于我们地址
//主页面
export default class Home extends React.Component{
    constructor(props){
        super(props)
        this.state={}
    }
    render(){
        return (
            <div>
                {/* 顶部导航 */}
                <TopNav hostory={this.props.history}></TopNav>
                {/* 搜索栏 */}
                <Search></Search>
                {/* 页面切换导航 */}
                <ContNav></ContNav>
                {/* 路由配置区域 */}
                <Switch>
                        <Route exact path='/index' component={Index}></Route>
                        <Route path='/greatLife' component={GreatLife}></Route>
                        <Route path='/lifeFood' component={LifeFood}></Route>
                        <Route path='/lifeArticles' component={LifeArticles}></Route>
                        <Route path='/lifeHouse' component={LifeHouse}></Route>
                        <Route path='/member' component={Member}></Route>
                        <Route path='/aboutUs' component={AboutUs}></Route>
                        <Redirect to='/index'></Redirect>
                </Switch>
                {/* 底部导航 */}
                <Bottom></Bottom>
            </div>
        )
    }

}